<% layout('layout') %>
<% block('head').append('<link type="text/css" href="/stylesheets/style.css">') %>
<% block('head').append('<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>') %>
<div ng-controller="CouponCtrl" ng-cloak class="ng-cloak">
    <div>
        <div class="am-margin-top-lg am-margin-left-sm">
            <span class="scor-color-gr-font">我的优惠券：</span>
            <span class="scor-color-FFF am-circle scor-border-radius-10 am-padding-horizontal-xs scor-bg-red" ><span ng-bind="couponNum"></span>张</span>
        </div>
        <div class="am-g am-margin-top scor-line-height-50 ">
            <div ng-click="getCouponAlert()" class="am-u-sm-6  am-text-center  scor-color-FFF">
                <div class="scor-bg-00D4AB-5">
                    <i class="am-icon-hand-o-up scor-font-size-18"></i>
                    <span class="scor-font-size-15 ">领取优惠券</span>
                </div>
            </div>
        </div>
        <div class="am-margin-sm"><span class="scor-color-gr-font">现金优惠券：</span>
            <span class="scor-color-red scor-font-weight-700"  >
                <span class="" ng-bind="xjCoupon.length"></span>张
            </span>
        </div>
        <hr data-am-widget="divider" class="am-divider am-divider-default" />
        <div ng-repeat="xj in xjCoupon">
            <div class="am-list am-margin-sm">
                <div class="am-g">
                    <div class="am-u-sm-7 am-padding-horizontal-0"><img class=" scor-img-200-75" ng-src="{{xj.fileurl}}?imageView2/1/w/500/h/200/q/100"></div>
                    <div class="am-u-sm-5 scor-bg-eee scor-height-75">
                        <div class="scor-font-weight-700 am-margin-0 am-text-center am-padding-top scor-font-size-18">
                            <span class="scor-color-red "><span ng-bind="xj.vaildDays"></span>天后</span>过期
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="am-margin-sm"><span class="scor-color-gr-font">满减优惠券：</span>
            <span class="scor-color-red scor-font-weight-700" >
                <span class="" ng-bind="mjCoupon.length"></span>张
            </span>
        </div>
        <hr data-am-widget="divider" class="am-divider am-divider-default" />
        <div ng-repeat="mj in mjCoupon">
            <div class="am-list am-margin-sm">
                <div class="am-g">
                    <div class="am-u-sm-7 am-padding-horizontal-0"><img class=" scor-img-200-75" ng-src="{{mj.fileurl}}?imageView2/1/w/500/h/200/q/100"></div>
                    <div class="am-u-sm-5 scor-bg-eee scor-height-75">
                        <div class="scor-font-weight-700 am-margin-0 am-text-center am-padding-top scor-font-size-18">
                            <span class="scor-color-red "><span ng-bind="mj.vaildDays"></span>天后</span>过期
                        </div>
                    </div>
                </div>
            </div>
       </div>
    </div>

    <div class="am-modal am-modal-alert am-radius" tabindex="-1" id="getCouponAlert">
        <div class="am-modal-dialog scor-bg-eee am-radius am-text-center">
            <div class="am-modal-hd scor-color-gr-font scor-font-weight-700 scor-font-size-22">领取优惠券</div>
            <form  data-am-validator  ng-submit="checkCouponForm()">
                <div class="am-text-center ">
                    <input type="text" autocomplete="off"  ng-model="couponCode"  placeholder="{{placeholder}}"  class="scor-line-height-40 scor-border-radius-none scor-font-size-18 scor-width-100-per am-text-center"/>
                </div>
                <div class="am-modal-footer">
                    <button type="submit"  class=" scor-width-height-100  scor-color-gr-font scor-border-none scor-bg-eee" >确定</button>
                </div>
            </form>
        </div>
    </div>

    <div class="am-modal am-modal-loading am-modal-no-btn"  tabindex="-1" id="icon-alert">
        <div class="am-modal-dialog scor-bg-opacity">
            <div class="am-modal-hd scor-color-FFF"><i class="am-icon-spinner am-icon-spin scor-font-size-40"></i></div>
        </div>
    </div>

    <div class="am-modal am-modal-alert" tabindex="-1" id="getCouponErr">
        <div class="am-modal-dialog">
            <div class="am-modal-hd scor-color-gr-font scor-font-weight-700">果然100</div>
            <div class="am-modal-bd scor-font-size-15" ng-bind="errContent">
            </div>
            <div class="am-modal-footer">
                <span class="am-modal-btn">确定</span>
            </div>
        </div>
    </div>
</div>
<% include ../navbar.ejs %>
<% block('footer').append('<script src="'+CDN+'script/coupon.js"></script>') %>
<% block('footer').append('<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>') %>